package com.soen341.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.stereotype.Repository;

import com.soen341.model.Course;

//--------------------------------------------------------------------------------------------------------------------------------
/**
* RegHistory DAO concrete implementation.
*/
//--------------------------------------------------------------------------------------------------------------------------------
@Repository("regHistoryDao")
public class RegHistoryDao
{
	private EntityManager entityManager;

	// -------------------------------------------------------------------------------
	@PersistenceContext
	public void setEntityManager(EntityManager entityManager)
	{
		this.entityManager = entityManager;
	}

	// -------------------------------------------------------------------------------
	public EntityManager getEntityManager()
	{
		return entityManager;
	}

	// -------------------------------------------------------------------------------
	@SuppressWarnings("unchecked")
	public List<Course> loadCompleted(String studentId)
	{
		// TODO: implement
		return null;
	}

	// -------------------------------------------------------------------------------
	@SuppressWarnings("unchecked")
	public List<Course> loadRegistered(String studentId)
	{
		// TODO: implement
		return null;
	}

	// -------------------------------------------------------------------------------
	@SuppressWarnings("unchecked")
	public List<Course> loadAvailable(String studentId)
	{
		// TODO: implement
		return null;
	}

/*
 * LOOK AT THE EXAMPLE
	// -------------------------------------------------------------------------------
	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
	public boolean save(Person person)
	{

		entityManager.persist(person);
		entityManager.flush();

		return true;
	}

	// -------------------------------------------------------------------------------
	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
	public boolean update(Person person)
	{
		entityManager.merge(person);
		entityManager.flush();
		return true;
	}
 */
}
